package com.jason.kotlin.meta.architecture2.api

import com.jason.kotlin.meta.architecture2.model.UserBean
import com.jason.kotlin.meta.architecture2.model.WanApiResponse
import retrofit2.http.*

/**
 * 用户信息的相关API接口
 */
interface UserService {

    @FormUrlEncoded
    @POST("/user/login")
    suspend fun login(@Field("username") username: String, @Field("password") password: String) : WanApiResponse<UserBean>

    @FormUrlEncoded
    @POST("/user/register")
    suspend fun register(@FieldMap map: HashMap<String, String>) : WanApiResponse<Any>

    @GET("/user/logout/json")
    suspend fun logout(): WanApiResponse<Any?>

}